import React from 'react';
import Layout from '../components/Layout';
import Header from '../components/Header';
import Menu from '../components/Menu';
import { Route, Switch } from 'react-router-dom';
import Welcome from './Welcome';
import StudentList from './student/StudentList';
import StudentAdd from './student/StudentAdd';
import StudentDetail from './student/StudentDetail';
import CoursesList from './course/CourseList';
import CoursesAdd from './course/CourseAdd';


export default function Admin() {
    return (
        <Layout
            header={<Header />}
            aside={<Menu />}
        >
            {/* <Route path='/' exact component={Welcome} />
            <Route path='/students' exact component={StudentList} />
            <Route path='/students/add' exact component={StudentAdd} />
            <Route path='/courses' exact component={CoursesList} />
            <Route path='/courses/add' exact component={CoursesAdd} /> */}
            {/* <React.Fragment>
                <Route path='/' exact component={Welcome} />
                <Route path='/students' exact component={StudentList} />
                <Route path='/students/add' exact component={StudentAdd} />
                <Route path='/students/:id(\d+)' exact component={StudentAdd} />
                <Route path='/courses' exact component={CoursesList} />
                <Route path='/courses/add' exact component={CoursesAdd} />
            </React.Fragment> */}
            <Switch>
                <Route path='/' exact component={Welcome} />
                <Route path='/students' exact component={StudentList} />
                <Route path='/students/add' exact component={StudentAdd} />
                <Route path='/students/:id(\d+)' exact component={StudentDetail} />
                <Route path='/courses' exact component={CoursesList} />
                <Route path='/courses/add' exact component={CoursesAdd} />
            </Switch>
        </Layout>
    )
}
